package SecondTier.Client;

import java.rmi.AlreadyBoundException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import java.util.Random;


/*
import serveur.AbonneImplementation;
import serveur.AbonneInterface;
import serveur.InformationInterface;
*/
import ThirdTier.Serveur.*;

public class Client {
	public static void main(String[] args) throws RemoteException, AlreadyBoundException, NotBoundException, InterruptedException, ClassNotFoundException{
		Registry unRegistry = LocateRegistry.getRegistry("127.0.0.1", 2000);
		
		ThirdTierServiceInterface unService = (ThirdTierServiceInterface) unRegistry.lookup("ThirdTierServiceInterface");
		int id = unService.setUtilisateur("test","1234");
				
		Utilisateur user = unService.getUtilisateur(1);
		System.out.println(user.getPseudo());
		
	}
}
